package com.sz.biz.rpt.service.impl;

import com.sz.biz.rpt.entity.RptSaleArea;
import com.sz.biz.rpt.entity.RptSaleCustomer;
import com.sz.biz.rpt.service.RptSaleAreaService;
import com.sz.common.base.service.AbstractService;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Function: //TODO ADD FUNCTION. <br>
 * Date: 2017年12月05日 11:47 <br>
 * Author: wentao.chang
 */
@Service
public class RptSaleAreaServiceImpl extends AbstractService implements RptSaleAreaService {
    @Override
    public int save(RptSaleArea rsa) {
        return dao.save("RptSaleAreaMapper.insert", rsa);
    }

    @Override
    public int update(RptSaleArea rsa) {
        return dao.update("RptSaleAreaMapper.updateById", rsa);
    }

    @Override
    public int delete(int id) {
        return dao.delete("RptSaleAreaMapper.deleteById", id);
    }

    @Override
    public RptSaleArea findById(int id) {
        return (RptSaleArea) dao.findForObject("RptSaleAreaMapper.selectById", id);
    }

    @Override
    public void deleteByDate(Date dateBegin) {
        dao.delete("RptSaleAreaMapper.deleteByDate", dateBegin);
    }

    @Override
    public List<RptSaleArea> findByParam(Map<String, Object> params) {
        return dao.findForList("RptSaleAreaMapper.findByParam", params, RptSaleArea.class);
    }
}
